//项目路由，导航配置文件
import {Navigation} from 'react-native-navigation'

import Login from './../screen/Login'
import My from './../screen/My'
import GoCircle from './../screen/GoCircle'
import GoHealth from './../screen/GoHealth'
import GoRun from './../screen/GoRun'
import GoStore from './../screen/GoStore'
import InputAuthCode from './../screen/InputAuthCode'
import Introduction from './../screen/Introduction'
import DongTaiDetail from './../components/DongTaiDetail'
import ShareCom from './../components/ShareCom'


// import App from './../../App'
// 注册所有的注册
Navigation.registerComponent('Login', ()=>Login)
Navigation.registerComponent('My', ()=>My)
Navigation.registerComponent('GoCircle', ()=>GoCircle)
Navigation.registerComponent('GoHealth', ()=>GoHealth)
Navigation.registerComponent('GoRun', ()=>GoRun)
Navigation.registerComponent('GoStore', ()=>GoStore)
Navigation.registerComponent('InputAuthCode', ()=>InputAuthCode)
Navigation.registerComponent('Introduction', ()=>Introduction)
Navigation.registerComponent('DongTaiDetail', ()=>DongTaiDetail)
Navigation.registerComponent('ShareCom', ()=>ShareCom)


// Navigation.registerComponent('App', ()=>App)


// 配置Rn中的导航：
// 1。欢迎屏幕的导航配置
export const WelcomeScreen = {
  root:{
    stack: {
      id:'WECLCOMESCREEN',
      children:[
         //栈可以用多个子对象初始化，在这种情况下，最后一个子对象将是当前显示的子对象，而第一个子对象将被隐藏。在这种情况下，back按钮将自动显示，单击它将返回到堆栈中，显示第一个(前一个)子元素。一但根子元素变得可见，back按钮就会被隐藏。
        {
          component:{
            name:'Introduction'
          }
        },
      ]
    }
  }
}
// 2。 登录屏幕的导航配置

export const LoginRoot = {
  root:{
    stack: {
      id: 'LOGIN_LAYOUT',
      children:[
        {
          component:{
            name:'Login'
          }
        }
      ]
    }
  }
}

//3. 配置APP主屏幕页面的布局结构； 
export const MainRoot={
  root: {
    //建议在栈中嵌套bottomTabs,bottomTabs中，嵌套stack
    bottomTabs: {
      id:'BOTTOM_TABS_LAYOUT',
      children:[
        // 每一个对象，就是一个bottomTab选项卡对象
        {
          stack: {
            id:'HOME_TAB',
            children:[
              {
                component:{
                  id:'GO_CIRCLE_SCREEN',
                  name: 'GoCircle',
                }
              }
            ],
            options: {
              bottomTab:{
                text:'GO圈', //bottomTabs显示的文本
                icon:require('../assets/bottomTabs/bts_gocircle_d.png'),//默认的图标
                selectedIcon: require('../assets/bottomTabs/bts_gocircle_ac.png'),//导航激活时显示
              }
            }
          }
        },
        {
          stack: {
            id:'HEALTH_TAB',
            children: [
              {
                component:{
                  id: 'GO_HEALTH_SCREEEN',
                  name: 'GoHealth'
                }
              }
            ],
            options:{
              bottomTab: {
                text:'GO健康', 
                icon:require('../assets/bottomTabs/bts_gohealth_d.png'),
                selectedIcon: require('../assets/bottomTabs/bts_gohealth_ac.png'),
              }
            }
          }
        },
        {
          stack: {
            id:'RUN_TAB',
            children: [
              {
                component:{
                  id: 'GO_RUN_SCREEEN',
                  name: 'GoRun'
                }
              }
            ],
            options:{
              bottomTab: {
                text:'GO运动', 
                icon:require('../assets/bottomTabs/bts_gorun_d.png'),
                selectedIcon: require('../assets/bottomTabs/bts_gorun_ac.png'),
              }
            }
          }
        },
        {
          stack: {
            id:'STORE_TAB',
            children: [
              {
                component:{
                  id: 'GO_STORE_SCREEEN',
                  name: 'GoStore'
                }
              }
            ],
            options:{
              bottomTab: {
                text:'GO商城', 
                icon:require('../assets/bottomTabs/bts_gostore_d.png'),
                selectedIcon: require('../assets/bottomTabs/bts_gostore_ac.png'),
              }
            }
          }
        },
        {
          stack: {
            id:'MY_TAB',
            children: [
              {
                component:{
                  id: 'MY_SCREEEN',
                  name: 'My'
                }
              }
            ],
            options:{
              bottomTab: {
                text:'我的', 
                icon:require('../assets/bottomTabs/bts_my_d.png'),
                selectedIcon: require('../assets/bottomTabs/bts_my_ac.png'),
              }
            }
          }
        },
      ]
    }
  }
}

// 4. 默认的APP导航样式的设置：
Navigation.setDefaultOptions({
  // 设置APP底部的整体的TABS的配置
  bottomTabs:{
    // titleDisplayMode:enum('alwaysShow','showWhenActive','alwaysHide')
    // v7.12版本中，默认是showWhenActive。
    titleDisplayMode:'alwaysShow'
  },
  // 手机状态栏的配置
  statusBar:{
    backgroundColor:'rgba(255,255,255,0.85)', //设置状态栏的背景色，
    style:'dark',//手机的模式，设置文字和手机信息等字体的颜色； 
    visible: true // false,不显示 状态栏, true,显示状态栏
  },
  // APP的顶部配置
  topBar:{
    title:{
      color:'black'
    },
    backButton:{
      color: '#666666'
    },
    background:{
      color:'#ffffff'
    }
  },
  // APP的底部的tab的配置
  bottomTab:{
    fontSize:12,
    selectedFontSize: 14,
    iconWidth:20,
    iconHeight:20,
    textColor:'#666666',
    selectedTextColor:'#0099FF',
    fontWeight:700
  }
})